<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var str = "Width=device-width";
    // slice(start,end) 包括开始,不包含结束
    console.log(str.slice(6, 12))
    console.log(str.slice(6, -2))

    // substring(start, end) 不能有复数
    console.log(str.substring(5, 7))
    console.log(str.substring(5, -7))
    // 结果是从开头开始截取长度为5的字符串

    // substr(str.length)
    console.log(str.substr(5, 10))
    console.log(str.substr(5)) 
    console.log(str.toUpperCase())
    console.log(str.toLocale())
</script>

</html>